namespace BusinessFramework
{
    public abstract class Validation<TValue> : Validation
    {
        public abstract bool Validate(TValue value);
        public override bool Validate(object value)
        {
            return Validate((TValue) value);
        }
        
    }

    public abstract class Validation
    {
        public Validation()
        {
            Severity = BrokenRuleSeverity.Error;
        }

        public abstract bool Validate(object value);
        
        public string Message { get; set; }
        public BrokenRuleSeverity Severity { get; set; }

        internal protected virtual Validation Copy()
        {
            return (Validation) MemberwiseClone();
        }
    }
}